package quickcheck;

import net.java.quickcheck.generator.iterable.Iterables;
import tester.Tester;

/**
 * 
 * @author Virag
 *
 */
public class NameTest {

	/**
	 * 
	 * @param t
	 */
	public void testName(Tester t) {
		//System.out.println("Starting at 0");
		int i = 0;
		for(Name name : Iterables.toIterable(new NameGenerator())) {
			//System.out.println(i + ":    " + author.getName() + " ... " + author.getAge());
			//assertEquals(author, new Author(author.getName(), author.getAge()));
			t.checkExpect(new Name(name.getFirst(), name.getLast()), name, "Success");
			t.checkFail(new Name("Virag", "Shah"), name, "Test to Fail");
			i++;
		}
	}

	/**
	 * 
	 * @param argv
	 */
	public static void main(String[] argv) {
		NameTest nt = new NameTest();

		System.out.println("Show all data defined in the NameTest class:");
		System.out.println("\n\n---------------------------------------------------");
		System.out.println("Invoke tester.runReport(this, true, true):");
		System.out.println("Print all data, all test results");

		Tester.runReport(nt, true, true);

		System.out.println("\n---------------------------------------------------");
		System.out.println("\n---------------------------------------------------");
		System.out.println("\n---------------------------------------------------");
		System.out.println("Invoke tester.runReport(this, false, false, true):");
		System.out.println("Print no data, all test results, no warnings");

		Tester.runReport(nt, false, false);
	}
}
